Notifications: link noticeable records to viewable pages with friendly names#1663
Merged
Merged
Conversation
PR #1656 fixed the notifications index but left the detail page calling polymorphic_path unconditionally, which raises for FormSubmission noticeables (bulk payments) that have no polymorphic route. Reuse the routable_path helper so the detail page links the same viewable destinations and degrades to plain text for routeless records. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The Record/Noticeable links rendered the raw model class ("EventRegistration",
"FormSubmission"), which says nothing about which record it is. Add
noticeable_label (registrant · event, submitter · form, or the record's own
name) and noticeable_type_label ("Registration", "Bulk payment", "Form
submission"). Render as a small type label over a text link rather than a button
so it mirrors the People column and doesn't compete with the row's View action.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
maebeale
commented
Jun 13, 2026
| <%= link_to @notification.noticeable.class.name, | ||
| polymorphic_path(@notification.noticeable), | ||
| class: "text-blue-600 hover:underline" %> | ||
| <% record_path = routable_path(@notification.noticeable) %> |
Collaborator
Author
There was a problem hiding this comment.
🤖 From Claude: This is the actual bug fix — #1656 only updated the index, leaving the detail page calling polymorphic_path unconditionally, which raised for FormSubmission noticeables (bulk payments). Reusing routable_path here makes it consistent and crash-safe.
maebeale
commented
Jun 13, 2026
| record.class.name.underscore.humanize | ||
| end | ||
|
|
||
| # A human-friendly name for a noticeable record (the registrant and event for a |
Collaborator
Author
There was a problem hiding this comment.
🤖 From Claude: noticeable_label special-cases registrations/submissions (registrant · event, submitter · form) and otherwise falls back through title/name/full_name, so any future noticeable type gets a sensible label without changes here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the goal of this PR and why is this important?
polymorphic_path, which:FormSubmissionnoticeables (bulk payments) — they have no polymorphic route, sopolymorphic_pathraised.EventRegistration,FormSubmission) that said nothing about which record it was.How did you approach the change?
routable_pathhelper (added by Notifications index: link form submission noticeables to a viewable page #1656 for the index) onshow.html.erbso it links the same viewable destinations and degrades to plain text for routeless records, instead of callingpolymorphic_pathunconditionally.noticeable_label— the record's name (registrant · event, submitter · form, or the record's owntitle/name).noticeable_type_label— plain-language type (Registration,Bulk payment,Form submission, else humanized model name).form_submission_path+ shared_submissionpartial already render bulk-payment submissions (including the attendee table); they route there automatically.UI Testing Checklist
Anything else to add?
🤖 Generated with Claude Code